package com.lecture.javamode.factory;

/**
 * 参数工厂类
 * @author luyn
 * @date 2024/03/13
 */
public class ParamFactory {

    public static ParamStrategy createParamStrategy(String type) {
        if ("type1".equals(type)) {
            return new Type1ParamStrategy();
        } else if ("type2".equals(type)) {
            return new Type2ParamStrategy();
        } else {
            throw new IllegalArgumentException("Invalid type");
        }
    }
}
